package com.liangdemo.web.previewingFileUpload.specification;

import java.util.ArrayList;
import java.util.List;

/**
 * 文件上传预览规范
 *
 * @author: LiangErLe
 * @date: 2022/9/28
 **/
public class PreviewingFileUploadSpecification {
    private static final List<String> illegalFileStrList = new ArrayList<>();

    /**
     * 检查文件名是否合规
     *
     * @param fileName 文件名
     * @return 合规结果, true:不合规，false:合规
     */
    public static boolean isIllegalFileName(String fileName) {
        for (String str : illegalFileStrList) {
            if (fileName.contains(str)) {
                return true;
            }
        }
        return false;
    }
}
